﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace NetDisk.Dtos
{
    public class LoginDto
    {
        [Required(ErrorMessage = "用户名必须填写.")]
        public string Name { get; set; }
        [Required(ErrorMessage = "用户密码必须填写.")]
        public string Password { get; set; }
    }

    public class ChangePasswordDto
    {
        [Required(ErrorMessage = "旧密码必须填写")]
        public string Password { get; set; }

        [ModelBinder(Name = "new_password")]
        [Required(ErrorMessage = "新密码必须填写")]
        public string NewPassword { get; set; }

        [ModelBinder(Name = "re_new_password")]
        [Compare("NewPassword", ErrorMessage = "确认密码必须跟新密码一致")]
        public string ReNewPassword { get; set; }
    }
}
